<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>调用luaclosure</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.luaclosure.html">LuaClosure</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.misc.html">Misc.</a></div>
 <div class="up"><a href="class.luaclosure.html">LuaClosure</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="luaclosure.invoke" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">LuaClosure::__invoke</h1>
  <p class="verinfo">(PECL lua &gt;=0.9.0)</p><p class="refpurpose"><span class="refname">LuaClosure::__invoke</span> &mdash; <span class="dc-title">调用luaclosure</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-luaclosure.invoke-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>LuaClosure::__invoke</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$arg</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$...</code></span>
  ] )</div>

  <p class="para rdfs-comment">

  </p>

  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">本函数还未编写文档，仅有参数列表。</p></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-luaclosure.invoke-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">arg</code></em></dt>

    <dd>

     <p class="para">
      
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">...</code></em></dt>

    <dd>

     <p class="para">
      
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-luaclosure.invoke-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-luaclosure.invoke-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-3677">
   <p><strong>Example #1 <span class="function"><strong>LuaClosure::__invoke()</strong></span>示例</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$lua&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Lua</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$closure&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$lua</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">eval</span><span style="color: #007700">(&lt;&lt;&lt;CODE<br /></span><span style="color: #DD0000">&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;(function&nbsp;()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print("hello&nbsp;world")<br />&nbsp;&nbsp;&nbsp;&nbsp;end)<br /></span><span style="color: #007700">CODE<br />);<br /><br /></span><span style="color: #0000BB">$lua</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">call</span><span style="color: #007700">(</span><span style="color: #0000BB">$closure</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/*&nbsp;after&nbsp;PHP&nbsp;5.3&nbsp;*/<br /></span><span style="color: #0000BB">$closure</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
hello worldhello world
</pre></div>
   </div>
  </div>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.luaclosure.html">LuaClosure</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.misc.html">Misc.</a></div>
 <div class="up"><a href="class.luaclosure.html">LuaClosure</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
